package com.shen.api.commons;


import com.shen.api.code.SystemCode;

/**
 * 工厂模式
 */
public class ResponseResultFactory<T> {

    /**
     * 构建一个通用的成功的返回结果
     * @return
     */
    public static ResponseResult buildResponseResult(){
        return new ResponseResult(SystemCode.TRAFFIC_SYSTEM_SUCCESS);
    }

    public static ResponseResult buildResponseResult(String code){
        return new ResponseResult(code);
    }

    public static <T> ResponseResult buildResponseResult(String code,T t){
        return new ResponseResult(code,t);
    }

    public static  ResponseResult buildResponseResult(String code,String resultMsg){
        return new ResponseResult(code,resultMsg);
    }
}
